<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>

    // 1 2 4 3  => Promise实例中 then方法对应的回调函数 => 不会再主线程直接执行(也会放在任务队列中 =>也属于异步任务)


    console.log(1);

    var p = new Promise(function (resolve, reject) {
        console.log(2);
        resolve(3);
    })
    console.log(p);
    p.then(function (num) {
        console.log(num);
    })

    console.log(4);




</script>

</html>